<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>网页编辑器 -- Powered by CentIMS {$core_version}</title>
		<link href="{'ui/smoothness/jquery-ui-1.8.20.c.css'|jquery}" rel="stylesheet"/>
		<link href="{'bootstrap/css/bootstrap.css'|shared}" rel="stylesheet"/>
		<link href="{'bootstrap/css/bootstrap-responsive.css'|shared}" rel="stylesheet"/>
		<link href="{'plugins/ztree/ztree.css'|jquery}" rel="stylesheet"/>
		<link href="{'common.css'|shared}" rel="stylesheet"/>
		<link rel="stylesheet" href="{'ueditor/themes/default/ueditor.css'|shared}"/>
		<link href="page.css" rel="stylesheet"/>
		{if $page_head_tpl}
			{include file=$page_head_tpl}
		{/if}	
		{'web_page_head'|fire:$page}
	</head>
	<body>
		<div class="workspace">
			{if !$hide_navi}
			{include file='core/views/vfs/vfs_navi.tpl'}
			{/if}			
		    <div id="page_info" class="alert hide">
		        <button class="close" id="page_info_close">×</button>
		        <div id="page_msg"></div>
	      	</div>					
			<form id="page-form" method="POST" action="./?Ctlr=SavePage">				
				<input type="hidden" name="page_id" id="page_id" value="{$page.page_id}"/>
				<input type="hidden" name="page_mode" id="page_mode" value="{$page.page_mode}"/>
				<div id="pagestuff">
					<div id="side-info-column" class="sidebar">
						<div id="side-sortables">
							
							<div class="postbox">
								<div title="点击以切换" class="handlediv"><br/></div>
								<h3 class="hndle"><span>发布:{$page.page_mode|status:$content_modes}</span></h3>	
								<div class="inside">
									<p>
										<button class="btn btn-save-draft" type="button"><i class="icon-file"></i>存草稿</button>
										<a id="btn-preview" class="btn pull-right {if !$page.page_id}hide{/if}" href="{$page.url|base}?preview" target="_blank"><i class="icon-globe"></i>预览</a>
										<br class="clear"/>
									</p>
									<div class="form-field">
										<label>网页类型</label>
										<select id="page_type" name="page_type" class="w150 pull-left" {if $page.page_type == 'template'}readonly="readonly"{/if}>
											{html_options options=$type_options selected=$page.page_type}
										</select>
										<span class="txt-info info">决定主题模板.</span>
							            <br class="clear"/>
									</div>
									<div class="form-field">
										<div>
											<span>模板</span>
											<label class="checkbox pull-left mg-r5"><input type="checkbox" name="custome_tpl_chk" id="custom-set-tpl"/>自定义</label>
											<br class="clear"/>								
										</div>
										<div class="input-append hide" id="tpl-wrapper">
							                <input class="w180" id="template_file" name="template_file"  value="{$page.template_file}" type="text"  readonly="readonly"/><button class="btn" type="button" id="btn-select-tpl">选择..</button>
							            </div>
									</div>
									<div class="form-field">
										<label>置顶到</label>																		
							            <input class="w180" id="ontopto" name="ontopto" type="text" value="{$page.ontopto}"/>
									</div>
									<div class="form-field">
										<label>缓存时间</label>												  									
							            <input class="w80 mg-r5" style="float:left;" id="cachetime" name="cachetime" value="{$page.cachetime}" type="text"/>
							            <span class="txt-info info">0表示不缓存，单位秒.</span>
							            <br class="clear"/>
									</div>
									<div class="form-field">
										<label class="checkbox"><input type="checkbox" name="commentable" id="commentable" {'1'|checked:$page.commentable}/>允许评论</label>
									</div>
									<p>
										<button class="btn btn-danger btn-move2trash {if !$page.page_id}hide{/if}" type="button"><i class="icon-trash"></i>移至回收站</button>										
										{icando res='page' op='publish'}
										<button class="btn btn-success pull-right btn-publish" type="button"><i class="icon-globe icon-white"></i>立即发布</button>
										{icandoelse}
										<button class="btn btn-info pull-right btn-approving" type="button"><i class="icon-filter icon-white"></i>提交审核</button>
										{/icando}
										<br class="clear"/>
									</p>
								</div>
							</div>
							
							<div class="postbox">
								<div title="点击以切换" class="handlediv"><br/></div>
								<h3 class="hndle"><span>标签与属性</span></h3>	
								<div class="inside">
									<div class="form-field">
										<label>属性</label>
										<ul id="page-flags">
											{foreach from=$flags item=item}
											<li><label class="checkbox"><input type="checkbox" name="flags[]" value="{$item.tag_id}" {$item.tag_id|checked:$page.flags}/>{$item.tag}</label></li>
											{/foreach}
										</ul>
										<br class="clear"/>
									</div>
									<div class="form-field">
										<div>
											<label class="pull-left mg-r5">标签</label>
											<span class="txt-info">多个标签以(,)分隔.</span>
											<br class="clear"/>								
										</div>
										<div class="input-append">		  									
								        	<input class="w150" id="tags" type="text"/><button class="btn" type="button" id="btn-add-tag">添加</button><button class="btn" type="button" id="btn-select-tag">常用</button>
								        </div>								        
									</div>
									<div class="form-field" id="page-tags">
										{foreach from=$page.tags item=item}
										<span class="tag label">
											<input type="hidden" name="tags[]" value="{$item.tag}"/>
											<i class="icon-trash"></i>{$item.tag}
										</span>
										{/foreach}										
										<br class="clear"/>
									</div>
								</div>
							</div>
							
							<div class="postbox closed">
								<div title="点击以切换" class="handlediv"><br/></div>
								<h3 class="hndle"><span>作者与来源</span></h3>	
								<div class="inside">
									<div class="form-field">
										<label>作者</label>
										<div class="input-append">		  									
							                <input class="w180" id="author" name="author" type="text" value="{$page.author}"/><button class="btn btn-enums" type="button" for="author" title="作者">选择..</button>
							            </div>
									</div>
									<div class="form-field">
										<label>来源</label>
										<div class="input-append">		  									
							                <input class="w180" id="source" name="source" type="text" value="{$page.source}"/><button class="btn btn-enums" type="button" for="source" title="来源">选择..</button>
							            </div>
									</div>								
								</div>
							</div>
							
							<div class="postbox {if !$page.figure}closed{/if}">
								<div title="点击以切换" class="handlediv"><br/></div>
								<h3 class="hndle"><span>页面插图</span></h3>	
								<div class="inside">
									<div id="page-picture" class="thumbnail mgb5">
										{if $page.figure}																												
										<img src="{$page.figure|url}" alt="页面插图"/>
										{else}
										<img src="{'images/260x180.gif'|shared}" alt="页面插图"/>
										{/if}										
										<input type="hidden" name="figure" id="figure" value="{$page.figure}"/>
										<input type="hidden" id="dfigure" value="{'images/260x180.gif'|shared}"/>
									</div>
									
									<p class="txt-ac">
										<button class="btn pull-left" type="button" id="btn-set-figure"><i class="icon-picture"></i>设置插图</button>
										<button class="btn pull-right" type="button" id="btn-del-figure"><i class="icon-trash"></i>删除插图</button>
										<br class="clear"/>
									</p>								
								</div>
							</div>
							
							{'web_page_metabox'|fire:$page}
							
							<div class="postbox">
								<div title="点击以切换" class="handlediv"><br/></div>
								<h3 class="hndle"><span>发布</span></h3>	
								<div class="inside">									
									<p>
										<button class="btn btn-save-draft" type="button"><i class="icon-file"></i>存草稿</button>
										{icando res='page' op='publish'}
										<button class="btn btn-success pull-right btn-publish" type="button"><i class="icon-globe icon-white"></i>立即发布</button>
										{icandoelse}
										<button class="btn btn-info pull-right btn-approving" type="button"><i class="icon-filter icon-white"></i>提交审核</button>
										{/icando}
										<br class="clear"/>
									</p>						
								</div>
							</div>
							
						</div>				
					</div>
					
					<div id="page-body">
						<div class="post-body-form">	
							<div class="form-field">
								<div class="pull-left" style="width:74%;">
									<label class="strong">标题</label>
									<input type="text" name="title" id="title" class="wp95" placeholder="在此建入标题" value="{$page.title}"/>
								</div>
								<div class="pull-left" style="width:25%;">
									<label class="strong">副标题</label>
	  								<input type="text" name="subtitle" id="subtitle" class="pretty"  placeholder="在此建入副标题" value="{$page.subtitle}"/>
	  							</div>
	  							<br class="clear"/>
							</div>
							<div class="form-field">
								<div class="pull-left wp45">
									<label class="strong">主栏目</label>
	  								<div class="input-append">
	  									<input type="hidden" name="category" id="category" value="{$page.category}"/>
						                <input class="span2" id="category_name" name="category_name" type="text" readonly="readonly" value="{$page.category_name}"/><button class="btn" type="button" id="btn-cate-select">选择..</button><button class="btn" type="button" id="btn-cate-reset">置空</button>
						            </div>
								</div>
								<div class="pull-left wp45">
									<label class="strong">副栏目</label>
	  								<div class="input-append">
	  									<input type="hidden" name="subcategory" id="subcategory" value="{$page.subcategory}"/>
						                <input class="span2" id="subcategory_name" name="subcategory_name" type="text" readonly="readonly" value="{$page.subcategory_name}"/><button class="btn" type="button" id="btn-subcate-select">选择..</button><button class="btn" type="button" id="btn-subcate-reset">置空</button>
						            </div>
								</div>
								<br class="clear"/>
							</div>
							<div class="form-field">
								<div>
									<span class="strong">URL</span>										
									<span class="txt-info">[以http://开头的URL将自动跳转,当页面类型为“模板页”时可以使用-{ldelim}args{rdelim}表示页面的参数.]</span>
									<br class="clear"/>								
								</div>
								<input type="text" name="url" id="url" class="pretty hide" value="{$page.url}"/>
							</div>
							<div class="form-field">
								<div>
									<span class="strong">关键词</span>										
									<span class="txt-info">[如果不填写，将使用全局定义的关键词，多个关键词以(,)分隔]</span>									
									<a class="pull-right mg-r5" id="select-keywords" href="#">常用关键词</a>
									<label class="checkbox pull-right mg-r5"><input type="checkbox" id="auto-keys-chk" name="auto_key"/>自动提取</label>
									<br class="clear"/>								
								</div>
								<input type="text" name="keywords" id="keywords" class="pretty" placeholder="在此键入关键词" value="{$page.keywords}"/>
							</div>
							<div class="form-field">
								<div>
									<span class="strong">页面描述</span>										
									<span class="txt-info">[如果不填写，将使用全局定义的描述]</span>									
									<br class="clear"/>								
								</div>
								<textarea class="pretty" name="descripition" placeholder="在此键入页面描述" id="descripition" rows="2">{$page.descripition}</textarea>
							</div>
							<div class="form-field">
								<div>
									<span class="strong">内容摘要</span>
									<br class="clear"/>								
								</div>
								<textarea class="pretty" name="summary" placeholder="在此键入页面描述" id="summary" rows="3">{$page.summary}</textarea>
							</div>
							{if $page_form_tpl}
								{include file=$page_form_tpl}
							{/if}
							<div class="form-field">
								<label class="checkbox pull-left mg-r5"><input type="checkbox" id="first_figure-chk" name="first_figure"/>提取第一张图片做插图</label>									
								<label class="checkbox pull-left mg-r5"><input type="checkbox" id="download-remote-chk" name="dr-picture"/>下载远程图片到本地</label>
								<br class="clear"/>
							</div>
							<script type="text/plain" id="myEditor">{$page.content}</script>
							{'web_page_form'|fire:$page}
						</div>
					</div>
					<br class="clear"/>
				</div>
	      	</form>
      	</div>      	
      	      	
      	<div class="modal hide" id="cate-tree-modal">
		  	<div class="modal-header">
			    <button class="close" data-dismiss="modal">×</button>
			    <h3>选择栏目</h3>
		  	</div>		  	
			<div class="modal-body" style="height:250px;overflow:auto;">
				<ul class="ztree" id="cate-tree"></ul>
			</div>						  
			<div class="modal-footer">				
				<a href="#" class="btn btn-close-form">关闭</a>
				<a href="#" class="btn btn-primary" id="btn-cate-done">确定</a>
			</div>
		</div>
		
		
		<div class="modal hide" id="tpl-tree-modal">
		  	<div class="modal-header">
			    <button class="close" data-dismiss="modal">×</button>
			    <h3>选择模板</h3>
		  	</div>
		  	
			<div class="modal-body" style="height:250px;overflow:auto;">
				<ul class="ztree" id="tpls-tree"></ul>
			</div>
						  
			<div class="modal-footer">
				<span id="tpl-info" class="label label-warning" style="margin-right:15px;display:none;">请选择模板!</span>
				<a href="#" class="btn btn-close-form">关闭</a>
				<a href="#" class="btn btn-primary" id="btn-tpl-done">确定</a>
			</div>
		</div>	
		      	
      	{'web_page_modal'|fire:$page}      	
		<script type="text/javascript" src="{'jquery-1.7.1.js'|jquery}"></script>
		<script type="text/javascript" src="{'ui/jquery-ui-1.8.20.c.js'|jquery}"></script>
		<script type="text/javascript" src="{'bootstrap/bootstrap.js'|shared}"></script>		
		<script type="text/javascript" src="{'plugins/ztree/ztree.js'|jquery}"></script>
		<script type="text/javascript" src="{'jquery.form.js'|jquery}"></script>
		<script type="text/javascript" src="{'common.js'|shared}"></script>
		<script type="text/javascript">
			var treeNodes = {$treeNodes};
			var tplNodes  = {$tplNodes};
			window.UEDITOR_HOME_URL = "{'ueditor/'|shared}";
			window.IMG_LIST_URL = "{'?Ctlr=ImageLists'|shared}";
			window.IMG_BASE_URL = "{''|base}";
		</script>
		<script type="text/javascript" src="{'ueditor/editor_config.js'|shared}"></script>
		<script type="text/javascript" src="{'ueditor/editor_all.js'|shared}"></script>
		<script type="text/javascript" src="page_form.js"></script>
		{if $page_foot_tpl}
			{include file=$page_foot_tpl}
		{/if}	
		{'web_page_foot'|fire:$page}
	</body>
</html>